"""
Copyright (c) 2007 Daniel Garcia Moreno <danigm@gmail.com>
Copyright (c) 2007 Eduardo Robles Elvira <edulix@gmail.com>
Licence: GPLv2
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
"""

class Vertex:

	def __init__(self, name, adjacents, pos=(0,0)):
		self._pos = pos
		self._name = name
		self._adjacents = adjacents
	
	def get_x(self):
		return self._pos[0]
	def get_y(self):
		return self._pos[1]
	def get_pos(self):
		return self._pos
	def set_x(self, x):
		self._pos[0] = x
	def set_y(self, y):
		self._pos[1] = y
	def set_pos(self, pos):
		self._pos = pos
	def get_name(self):
		return self._name
	def get_adjacents(self):
		return self._adjacents
	def set_adjacents(self, adjacents):
		self._adjacents = adjacents
	def add_adjacent(self, vertex):
		self._adjacents.append(vertex)
	def remove_adjacent(self, vertex):
		self._adjacents.remove(vertex) # remove first occurrence of vertex only
